--[[
    @desc 事件订阅者和派发者模式
    @author zch
    @data:2022-04-18 09:59:00
]]

EventDispatcher = EventDispatcher or BaseClass()
local EventDispatcher = EventDispatcher
local EventSystem = EventSystem

function EventDispatcher:__init()
    self.eventSys = EventSystem.New()
end

function EventDispatcher:Bind(event_key, event_func)
	return EventSystem.Bind(self.eventSys, event_key, event_func)
end

function EventDispatcher:UnBind(event_id)
	EventSystem.UnBind(self.eventSys, event_id)
end

function EventDispatcher:UnBindAll()
	EventSystem.UnBindAll(self.eventSys)
end

function EventDispatcher:Fire(event_key, ...)
	EventSystem.Fire(self.eventSys, event_key, ...)
end